import request from "@/utils/http"
//左侧数据
export  function  getUserFn(){
  return request({
    url:"/system/user/deptTree",
    method:"get",
  })
}
//右侧表格
export  function  listUserFn(params){
  return request({
    url:"/system/user/list",
    method:"get",
    params
  })
}

//岗位 /system/user/id get posts.   roles
export function getUsersInfo() {
  return request({
    url: `/system/user/`, // 确保接口路径正确
    method: "get"
  });
}
//switch 开关
export function  switchFunInfo(data){
  return request({
    url:'/system/user/changeStatus',
    method:"put",
    data
  })
}
//添加
export function  addAxiofFunInf(data){
  return request({
    url:'/system/user',
    method:'post',
    data
  })
}
//修改
export function  editPutFn(data){
  return request({
    url:'/system/user',
    method:'put',
    data
  })
}
//删除
export function deletePostFn(userIds) {
  return request({
    url: `/system/user/${userIds.join(',')}`, // 将 userIds 转换为逗号分隔的字符串
    method: 'delete'
  })
}

//导出
export function  exportUserForm(data){
  return request({
    url:"/system/user/export",
    method:"post",
    data,
    responseType:"blob"
  })
}

//导入 system/user/importData?updateSupport=0

export  function exportUserchannel(data){
  return request({
    url:"system/user/importData",
    method:"post",
    data
  })
}